<?php

declare(strict_types=1);
/*
 * This file is part of Leonsw.
 *
 * @link     https://leonsw.com
 * @document https://docs.leonsw.com
 * @contact  leonsw.com@gmail.com
 * @license  https://leonsw.com/LICENSE
 */
namespace App\Resource\Lottery3\Rank;

use Illuminate\Http\Resources\Json\JsonResource;

class Resource extends JsonResource
{
    public function toArray($request)
    {
        return [
            'user_id' => $this->user_id,
            'code' => $this->user->user_code ?? '',
            'nickname' => $this->user->nickname ?? '',
            'avatar' => $this->user->head_picture ?? '',
            'index' => $this->index,
            'diff' => $this->diff,
        ];
    }
}
